home *** CD-ROM | disk | FTP | other *** search
- class Cubix extends MovieClip
- {
- var nameV;
- var numberV;
- var typeV;
- var widthV;
- var heightV;
- var xPosSV;
- var yPosSV;
- var backM;
- var shadowM;
- var lineM;
- var numberWin;
- var intervalIDV;
- var xPosV;
- var yPosV;
- var moveTypeNumV;
- var fpsV = 70;
- var intervalSecV = 1000 / this.fpsV;
- var delaySecV = 300;
- var moveSpeedV = 0.1;
- var checkTrig = false;
- var colorStartV = 0;
- function Cubix()
- {
- super();
- }
- function intF(nameV, numberV, typeV, widthV, heightV, xPosSV, yPosSV, colorStartV)
- {
- this.nameV = nameV;
- this.numberV = numberV;
- this.typeV = typeV;
- this.widthV = widthV;
- this.heightV = heightV;
- this.xPosSV = xPosSV;
- this.yPosSV = yPosSV;
- this.colorStartV = colorStartV;
- this.backM._width = this.widthV - 4;
- this.backM._height = this.heightV - 4;
- this.shadowM._width = this.widthV;
- this.shadowM._height = this.heightV;
- this.lineM._width = this.widthV - 4;
- this.lineM._height = this.heightV - 4;
- }
- function showTestWinF()
- {
- this.numberWin.text = this.numberV;
- }
- function setTypeF(typeV)
- {
- this.typeV = typeV;
- }
- function changeTypeF(typeV)
- {
- this.typeV = typeV;
- this.backM.gotoAndStop("s" + Number(Number(this.typeV) + Number(this.colorStartV)) + "L");
- }
- function changeInfoArrayPositionF(xPosSV, yPosSV)
- {
- this.xPosSV = xPosSV;
- this.yPosSV = yPosSV;
- }
- function changeInfoStagePositionF(xPosV, yPosV, moveTypeNumV, moveSpeedV)
- {
- clearInterval(this.intervalIDV);
- this.xPosV = xPosV;
- this.yPosV = yPosV;
- this.moveTypeNumV = moveTypeNumV;
- this.moveSpeedV = moveSpeedV;
- if(this.moveTypeNumV == 1)
- {
- this.intervalIDV = setInterval(this,"moveStagePositionF2",this.intervalSecV);
- }
- else if(this.moveTypeNumV == 2)
- {
- this.intervalIDV = setInterval(this,"delayF",this.delaySecV);
- }
- else if(this.moveTypeNumV == 3)
- {
- this.intervalIDV = setInterval(this,"moveStagePositionF2",this.intervalSecV);
- }
- }
- function delayF()
- {
- clearInterval(this.intervalIDV);
- this.intervalIDV = setInterval(this,"moveStagePositionF3",this.intervalSecV);
- }
- function moveStagePositionF1()
- {
- this._x = this.xPosV;
- this._y = this.yPosV;
- }
- function moveStagePositionF2()
- {
- this._x += (this.xPosV - this._x) * this.moveSpeedV;
- this._y += (this.yPosV - this._y) * this.moveSpeedV;
- if(Math.abs(this.xPosV - this._x) < 1 and Math.abs(this.yPosV - this._y) < 1)
- {
- this._x = this.xPosV;
- this._y = this.yPosV;
- clearInterval(this.intervalIDV);
- _root.moveEndCheckF1();
- }
- }
- function moveStagePositionF3()
- {
- this._x += (this.xPosV - this._x) * this.moveSpeedV;
- this._y += (this.yPosV - this._y) * this.moveSpeedV;
- if(Math.abs(this.xPosV - this._x) < 1 and Math.abs(this.yPosV - this._y) < 1)
- {
- this._x = this.xPosV;
- this._y = this.yPosV;
- clearInterval(this.intervalIDV);
- _root.moveEndCheckF2();
- }
- }
- }
-